﻿/* 
 * TABLE: dbo.Friends 
 */

/* 
 * TABLE: Friends 
 */

CREATE TABLE Friends(
    UserId        int    NOT NULL,
    IsAccepted    bit    CONSTRAINT [IsAccepted] DEFAULT 0 NULL,
    FriendId      int    NOT NULL,
    CONSTRAINT PK_Friends PRIMARY KEY NONCLUSTERED (UserId, FriendId)
)
GO
ALTER TABLE Friends ADD CONSTRAINT FKUsers_Friends 
    FOREIGN KEY (UserId)
    REFERENCES Users(UserId)
GO
/* 
 * TABLE: dbo.Friends 
 */

/* 
 * TABLE: Friends 
 */

ALTER TABLE Friends ADD CONSTRAINT FKUsers_Frie13 
    FOREIGN KEY (FriendId)
    REFERENCES Users(UserId)